home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 October / Macformat17.cdr / Shareware City / Developers / GAL ƒ / GAL examples / exclusive or < prev    next >
Encoding:
Text File  |  1994-07-11  |  373 b   |  18 lines  |  [TEXT/ttxt]

  1. ; construct xor
  2.  
  3.     begin_code
  4.     copy    firstop=>reg1
  5.     copy    secondop=>reg2
  6.     copy    reg1=>reg3        ; make two copies
  7.     copy    reg2=>reg4
  8.     or        reg1=>reg2        ; A or B
  9.     and    reg3=>reg4        ; A and B
  10.     not    reg4                ; not(A and B)
  11.     and     reg2=>reg4        ; A xor B
  12.     halt
  13.     end_code
  14.     begin_data
  15. firstop    constant    255        ; last 8 digits: 1111 1111
  16. secondop    constant    170        ; last 8 digits: 1010 1010
  17.     end_data
  18.     end